#include <iostream>
#include <memory>
#include <functional>

using namespace std::tr1::placeholders;
using std::tr1::bind;
using namespace std;

class calc
{
public:
	calc(int base)
	{
		m_base = base;
	}

	int Add(int j)
	{
		m_base += j;
		return m_base;
	}

	int sub(int j)
	{
		m_base -= j;
		return m_base;
	}
protected:
	int m_base;
};
int main(int argc, char *argv[])
{
	calc *c = new calc(10);
	tr1::function<int(int x)> fun;


	fun = tr1::bind(&calc::Add, c, _1);
	cout << fun(3) << endl;

}

//end